import request from '@/utils/request'
import axios from 'axios'

axios.defaults.baseURL = 'http://localhost:8000'; // 后端接口地址

export function getTopicsByTag(paramMap) {
    return request({
        url: '/tag/' + paramMap.name,
        method: 'get',
        params: {
            page: paramMap.page,
            size: paramMap.size
        }
    })
}

export function getTags(searchText) {
    // 发送请求获取标签列表
    // return request(({
    //   url: '/tag/list',
    //   method: 'get'
    return axios.get('/tag/list?keyword=' + searchText)
    // }))
}

export function deleteTag(id) {

    return axios.delete('/tag/delete/' + id)
    // }))
}

export function updateTag(data) {
    return request({
        url: '/tag/update',
        method: 'post',
        data: data
    })
}
